home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Dialogs.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  5.3 KB  |  194 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 13, 1991 at 4:38 PM
  3.     Dialogs.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.     1985-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Dialogs;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingDialogs}
  21. {$SETC UsingDialogs := 1}
  22.  
  23. {$I+}
  24. {$SETC DialogsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingWindows}
  27. {$I $$Shell(PInterfaces)Windows.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingTextEdit}
  30. {$I $$Shell(PInterfaces)TextEdit.p}
  31. {$ENDC}
  32. {$SETC UsingIncludes := DialogsIncludes}
  33.  
  34. CONST
  35. ctrlItem = 4;
  36. btnCtrl = 0;
  37. chkCtrl = 1;
  38. radCtrl = 2;
  39. resCtrl = 3;
  40. statText = 8;
  41. editText = 16;
  42. iconItem = 32;
  43. picItem = 64;
  44. userItem = 0;
  45. itemDisable = 128;
  46. ok = 1;
  47. cancel = 2;
  48. stopIcon = 0;
  49. noteIcon = 1;
  50. cautionIcon = 2;
  51.  
  52. TYPE
  53. ResumeProcPtr = ProcPtr;        { PROCEDURE Resume; } 
  54. SoundProcPtr = ProcPtr;         { PROCEDURE DoSound; } 
  55. ModalFilterProcPtr = ProcPtr;   { FUNCTION Filter(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: INTEGER): BOOLEAN; }
  56.  
  57. DialogPeek = ^DialogRecord;
  58. DialogRecord = RECORD
  59.     window: WindowRecord;
  60.     items: Handle;
  61.     textH: TEHandle;
  62.     editField: INTEGER;
  63.     editOpen: INTEGER;
  64.     aDefItem: INTEGER;
  65.     END;
  66.  
  67. DialogPtr = WindowPtr;
  68.  
  69. DialogTPtr = ^DialogTemplate;
  70. DialogTHndl = ^DialogTPtr;
  71. DialogTemplate = RECORD
  72.     boundsRect: Rect;
  73.     procID: INTEGER;
  74.     visible: BOOLEAN;
  75.     filler1: BOOLEAN;
  76.     goAwayFlag: BOOLEAN;
  77.     filler2: BOOLEAN;
  78.     refCon: LONGINT;
  79.     itemsID: INTEGER;
  80.     title: Str255;
  81.     END;
  82.  
  83. StageList = PACKED RECORD
  84.     boldItm4: 0..1;             {default button item number - 1}
  85.     boxDrwn4: BOOLEAN;          {true if alert box to be drawn}
  86.     sound4: 0..3;               {sound number}
  87.     boldItm3: 0..1;
  88.     boxDrwn3: BOOLEAN;
  89.     sound3: 0..3;
  90.     boldItm2: 0..1;
  91.     boxDrwn2: BOOLEAN;
  92.     sound2: 0..3;
  93.     boldItm1: 0..1;
  94.     boxDrwn1: BOOLEAN;
  95.     sound1: 0..3;
  96.     END;
  97.  
  98. AlertTPtr = ^AlertTemplate;
  99. AlertTHndl = ^AlertTPtr;
  100. AlertTemplate = RECORD
  101.     boundsRect: Rect;
  102.     itemsID: INTEGER;
  103.     stages: StageList;
  104.     END;
  105.  
  106.  
  107. PROCEDURE InitDialogs(resumeProc: ResumeProcPtr);
  108.     INLINE $A97B;
  109. PROCEDURE ErrorSound(soundProc: SoundProcPtr);
  110.     INLINE $A98C;
  111. FUNCTION NewDialog(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  112.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT;
  113.     itmLstHndl: Handle): DialogPtr;
  114.     INLINE $A97D;
  115. FUNCTION GetNewDialog(dialogID: INTEGER;dStorage: Ptr;behind: WindowPtr): DialogPtr;
  116.     INLINE $A97C;
  117. PROCEDURE CloseDialog(theDialog: DialogPtr);
  118.     INLINE $A982;
  119. PROCEDURE DisposDialog(theDialog: DialogPtr);
  120.     INLINE $A983;
  121. PROCEDURE DisposeDialog(theDialog: DialogPtr);
  122.     INLINE $A983;
  123. PROCEDURE CouldDialog(dialogID: INTEGER);
  124.     INLINE $A979;
  125. PROCEDURE FreeDialog(dialogID: INTEGER);
  126.     INLINE $A97A;
  127. PROCEDURE ParamText(param0: Str255;param1: Str255;param2: Str255;param3: Str255);
  128.     INLINE $A98B;
  129. PROCEDURE ModalDialog(filterProc: ModalFilterProcPtr;VAR itemHit: INTEGER);
  130.     INLINE $A991;
  131. FUNCTION IsDialogEvent(theEvent: EventRecord): BOOLEAN;
  132.     INLINE $A97F;
  133. FUNCTION DialogSelect(theEvent: EventRecord;VAR theDialog: DialogPtr;VAR itemHit: INTEGER): BOOLEAN;
  134.     INLINE $A980;
  135. PROCEDURE DrawDialog(theDialog: DialogPtr);
  136.     INLINE $A981;
  137. PROCEDURE UpdtDialog(theDialog: DialogPtr;updateRgn: RgnHandle);
  138.     INLINE $A978;
  139. PROCEDURE UpdateDialog(theDialog: DialogPtr;updateRgn: RgnHandle);
  140.     INLINE $A978;
  141. FUNCTION Alert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER;
  142.     INLINE $A985;
  143. FUNCTION StopAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER;
  144.     INLINE $A986;
  145. FUNCTION NoteAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER;
  146.     INLINE $A987;
  147. FUNCTION CautionAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER;
  148.     INLINE $A988;
  149. PROCEDURE CouldAlert(alertID: INTEGER);
  150.     INLINE $A989;
  151. PROCEDURE FreeAlert(alertID: INTEGER);
  152.     INLINE $A98A;
  153. PROCEDURE GetDItem(theDialog: DialogPtr;itemNo: INTEGER;VAR itemType: INTEGER;
  154.     VAR item: Handle;VAR box: Rect);
  155.     INLINE $A98D;
  156. PROCEDURE SetDItem(theDialog: DialogPtr;itemNo: INTEGER;itemType: INTEGER;
  157.     item: Handle;box: Rect);
  158.     INLINE $A98E;
  159. PROCEDURE HideDItem(theDialog: DialogPtr;itemNo: INTEGER);
  160.     INLINE $A827;
  161. PROCEDURE ShowDItem(theDialog: DialogPtr;itemNo: INTEGER);
  162.     INLINE $A828;
  163. PROCEDURE SelIText(theDialog: DialogPtr;itemNo: INTEGER;strtSel: INTEGER;
  164.     endSel: INTEGER);
  165.     INLINE $A97E;
  166. PROCEDURE GetIText(item: Handle;VAR text: Str255);
  167.     INLINE $A990;
  168. PROCEDURE SetIText(item: Handle;text: Str255);
  169.     INLINE $A98F;
  170. FUNCTION FindDItem(theDialog: DialogPtr;thePt: Point): INTEGER;
  171.     INLINE $A984;
  172. FUNCTION NewCDialog(dStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  173.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT;
  174.     items: Handle): DialogPtr;
  175.     INLINE $AA4B;
  176. FUNCTION GetAlrtStage: INTEGER;
  177.     INLINE $3EB8,$0A9A;
  178. PROCEDURE ResetAlrtStage;
  179.     INLINE $4278,$0A9A;
  180. PROCEDURE DlgCut(theDialog: DialogPtr);
  181. PROCEDURE DlgPaste(theDialog: DialogPtr);
  182. PROCEDURE DlgCopy(theDialog: DialogPtr);
  183. PROCEDURE DlgDelete(theDialog: DialogPtr);
  184. PROCEDURE SetDAFont(fontNum: INTEGER);
  185.     INLINE $31DF,$0AFA;
  186.  
  187.  
  188. {$ENDC}    { UsingDialogs }
  189.  
  190. {$IFC NOT UsingIncludes}
  191.     END.
  192. {$ENDC}
  193.  
  194.